package cn.com.selfsoft.smartcity.core.service;

import cn.com.self.apis.portal.util.ICustomPage;
import cn.com.selfsoft.smartcity.commons.exception.EntityNotFoundException;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * @param <T>
 * @param <K>
 * @param <R>
 *
 */
public abstract class GenericServiceImpl<T, K extends Serializable, R> implements GenericService<T, K, R> {

    @Override
    public long count(T entity) {
        throw new UnsupportedOperationException("operation count is unsupported");
    }

    @Override
    public long count(Map<String, Object> parameterMap) {
        throw new UnsupportedOperationException("operation count is unsupported");
    }

    @Override
    public Page<R> page(T entity, Pageable page) {
        throw new UnsupportedOperationException("operation page is unsupported");
    }

    @Override
    public ICustomPage<R> page(Map<String, Object> parameterMap, Pageable page) {
        throw new UnsupportedOperationException("operation page is unsupported");
    }

    @Override
    public List<R> list(T entity, Sort sort) {
        throw new UnsupportedOperationException("operation list is unsupported");
    }

    @Override
    public List<R> list(Map<String, Object> parameterMap, Sort sort) {
        throw new UnsupportedOperationException("operation list is unsupported");
    }

    @Override
    public R load(K id) {
        throw new UnsupportedOperationException("operation load is unsupported");
    }

    @Override
    public R load(T entity) {
        throw new UnsupportedOperationException("operation load is unsupported");
    }

    @Override
    public void delete(K id) throws EntityNotFoundException {
        throw new UnsupportedOperationException("operation delete is unsupported");
    }

    @Override
    public void delete(T entity) throws EntityNotFoundException {
        throw new UnsupportedOperationException("operation delete is unsupported");
    }

    @Override
    public R create(T entity, String... ignoreProperties) {
        throw new UnsupportedOperationException("operation create is unsupported");
    }

    @Override
    public R update(T entity, String... ignoreProperties) throws EntityNotFoundException {
        throw new UnsupportedOperationException("operation update is unsupported");
    }

}
